home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-03-24 | 762 b | 41 lines | [TEXT/PJMM] |
- program main;
-
- uses
- ErrSignal;
-
- procedure CleanupHandler (value: univ Longint);
- begin
- writeln('in CleanupHandler: ', value : 1);
- end;
-
- procedure TestProc;
- var
- catch: Integer;
- begin
- writeln('entering TestProc');
- catch := CatchSignal;
- if catch <> 0 then
- begin
- writeln('first catch in TestProc');
- PassSignal(2);
- end
- else
- writeln('catch established in TestProc');
- Cleanup(1, 0);
- Cleanup(2, 0);
- Cleanup(3, 0);
- Signal(1);
- end;
-
- var
- mainCatch: Integer;
-
- begin { main }
- ShowText;
- InitSignals(sigFail);
- Ignore(RegisterCleanupAction(@CleanupHandler));
- mainCatch := CatchSignal; {Without this - we never return from test Proc - Why?}
- if mainCatch = 0 then
- TestProc;
- writeln('returned to main: ', mainCatch);
- end.